<?php

namespace Database\Seeders;

use App\Models\Setting;
use Illuminate\Database\Seeder;

class SettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $settings = [
            ["type" => "site_setting", "cn_name" => "站点设置", "value" => [
                'site_logo' => 'logo.jpg',
                'site_slogan' => 'slogan.jpg',
                'site_name' => '三枪考试系统',
                'site_code' => ''
            ]],
            ['type' => 'oss', "cn_name" => "阿里oss", 'value' => [
                'access_key' => '',
                'secret_key' => '',
                'bucket' => '',
                'endpoint' => 'www.sanqiang.com',
                'is_name' => false
            ]],
            ['type' => 'sms', "cn_name" => "短信设置", 'value' => [
                'access_key' => '',
                'secret_key' => '',
                'sign_tem' => '短信模板',
                'sign_name' => '短信签名'
            ]],
            ['type' => 'authorization_login', "cn_name" => "授权登录", 'value' => [
                'authorization_model' => [
                    'disable' => false,
                    'manual_authorization' => true,
                    'auto_authorization' => false,
                ],
                'authorization_url' => '授权页面地址',
                'authorization_token_url' => '鉴权Token地址',
                'user_url' => '用户信息地址',
                'client_id' => '客户端id',
                'client_secret' => '客户端秘钥',
            ]],
            ['type' => 'user_agreement', "cn_name" => "用户注册保密协议", 'value' => [
                'title' => '用户注册保密协议标题',
                'confidentiality_agreement' => '用户注册保密协议内容'
            ]],
            ['type' => 'technical_help', "cn_name" => "技术帮助", 'value' => [
                'content' => '技术帮助内容'
            ]], ['type' => 'toefl_ibt', "cn_name" => "考试须知", 'value' => [
                'title' => '考试须知标题',
                'content' => '考试须知内容'
            ]], ['type' => 'emigrated_roles', "cn_name" => "闯关规则", 'value' => [
                'title' => '闯关规则标题',
                'content' => '闯关规则内容'
            ]]
        ];

        foreach ($settings as $item) {
            Setting::create($item);
        }
    }
}
